package com.qf;

public class LamdbaTest {

    public static void main(String[] args) {
        LamdbaTest lamdbaTest = new LamdbaTest();

        lamdbaTest.test();

        System.out.println("============");
        System.out.println(lamdbaTest);
    }

    public void test(){
        //创建一个Runnable对象
        Runnable run1 = new Runnable() {
            @Override
            public void run() {
                System.out.println(this);
                System.out.println("run1~~~");
            }
        };

        //lambda
        Runnable run2 = ()->{
            System.out.println(this);
            System.out.println("run2~~~");
        };

        run1.run();
        run2.run();
    }
}
